<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>属性绑定</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
  <link rel="stylesheet" href="./style.css">
</head>
<body>
  <div id="app">
    <h1 :class="title">我是红色</h1>
    <div>
      <button v-on:click="changeColor">change color</button>
    </div>
  </div>
  <script>
    new Vue({
      el: '#app',
      data: {
        title: "title1"
      },
      methods: {
        changeColor() {
          this.title = 'title2'
        }
      },
    })
  </script>
</body>
</html>